package com.jxd.dianping.common;

import lombok.Getter;

@Getter
public enum EmBusinessError {
    // 通用类型 1000X
    NO_OBJECT_FOUND(10001, "请求对象不存在"),
    UNKNOWN_ERROR(10002, "未知错误"),
    NO_HANDLER_FOUND(10003, "找不到访问路径"),
    PARAMETER_BINDING_ERROR(10004,"参数绑定异常"),
    PARAMETER_VALIDATION_ERROR(10005, "参数有效性异常"),

    // 用户相关 2000X
    REGISTER_DUP_FAIL(20001, "用户已存在"),
    USER_NOT_EXIST(20002,"用户不存在"),
    LOGIN_ERROR(20003, "手机号或密码错误"),

    // Admin相关 3000X
    ADMIN_SHOULD_LOGIN(30001, "管理员尚未登录"),

    // 商户相关 4000X
    SELLER_STATUS_ERROR(40001,"商户状态错误"),
    SELLER_NOT_EXIST(40002,"商户不存在"),

    // 品类相关 5000X
    CATEGORY_NOT_EXIST(50001, "品类不存在"),
    CATEGORY_NAME_DUP(50002, "品类名已存在"),

    // 门店相关 6000X
    SHOP_NOT_EXIST(60001, "门店不存在"),
    ;

    private Integer errorCode;
    private String errorMsg;

    EmBusinessError(Integer errorCode, String errorMsg) {
        this.errorCode = errorCode;
        this.errorMsg = errorMsg;
    }

    public void setErrorCode(Integer errorCode) {
        this.errorCode = errorCode;
    }

    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }
}
